//    Copyright (C) Kherty.  All rights reserved.
#region

using System.ComponentModel;
using System.Windows;
using System.Windows.Data;
using OpenLS.Drawing.UI.Internals;

#endregion

namespace OpenLS.Spreadsheet.UI.Internals
{
    public static class SpreadsheetConverters
    {
        private static readonly DefinedNamesViewFactory _definedNamesFactory = new DefinedNamesViewFactory();
        public static IValueConverter DefinedNamesFactory { get { return _definedNamesFactory; } }
        private static readonly ColorToTabForegroundConverter _colorToTabForegroundConverter = new ColorToTabForegroundConverter();
        public static IMultiValueConverter ColorToTabForegroundConverter { get { return _colorToTabForegroundConverter; } }
        private static readonly ColorToTabBackgroundConverter _colorToTabBackgroundConverter = new ColorToTabBackgroundConverter();
        public static IMultiValueConverter ColorToTabBackgroundConverter { get { return _colorToTabBackgroundConverter; } }
        static readonly FilterColumnViewModelsFactory _FilterColumnViewModelsFactory = new FilterColumnViewModelsFactory();
        public static IValueConverter FilterColumnViewModelsFactory{get{ return _FilterColumnViewModelsFactory;}}
        private static readonly ViewModelFactory _ViewModelFactory = new ViewModelFactory();
        public static IValueConverter ViewModelFactory { get { return _ViewModelFactory; } }
        static readonly BorderStyleToThicknessConverter _BorderStyleToThicknessConverter = new BorderStyleToThicknessConverter();
        public static IValueConverter BorderStyleToThicknessConverter {get{ return _BorderStyleToThicknessConverter;}}
        static readonly BorderStyleToDashConverter _BorderStyleToDashConverter = new BorderStyleToDashConverter();
        public static IValueConverter BorderStyleToDashConverter { get { return _BorderStyleToDashConverter; } }
        static readonly NotConverter _notConverter = new NotConverter();
        public static IValueConverter NotConverter { get { return _notConverter; } }
        private static readonly BorderThicknessConverter _borderThicknessConverter = new BorderThicknessConverter();

        private static readonly ChartTemplateToImageSourceConverter _chartTemplateToImageSourceConverter =
            new ChartTemplateToImageSourceConverter();

        private static readonly ColorToBrushConverter _colorToBrushConverter = new ColorToBrushConverter();
        private static readonly EnsureWhiteConverter _ensureWhiteConverter = new EnsureWhiteConverter();
//        private static readonly FillToBrushConverter _fillToForegroundBrushConverter = new FillToForegroundBrushConverter();
        private static readonly FillToBrushConverter _fillToBackgroundBrushConverter = new FillToBrushConverter();
        private static readonly FirstNonNullConverter _firstNonNullConverter = new FirstNonNullConverter();
        private static readonly FromPercentConverter _fromPercentConverter = new FromPercentConverter();
        private static readonly GetColumnsConverter _getColumnsConverter = new GetColumnsConverter();

        private static readonly HorizontalCellAlignmentToHorizontalAlignmentConverter _horizontalCellAlignmentConverter
            = new HorizontalCellAlignmentToHorizontalAlignmentConverter();

        private static readonly IndentationToThicknessConverter _indentationToThicknessConverter =
            new IndentationToThicknessConverter();

        private static readonly EqualConverter _isBold = new EqualConverter(FontWeights.Normal, FontWeights.Bold);
        private static readonly EqualConverter _isBottom = new EqualConverter(null, VerticalCellAlignment.Bottom);

        private static readonly EqualConverter _isDoubleConverter = new EqualConverter(UnderlineType.None,
                                                                                       UnderlineType.Double);

        private static readonly EqualConverter _isHCenter = new EqualConverter(null, HorizontalCellAlignment.Center);
        private static readonly EqualConverter _isItalic = new EqualConverter(FontStyles.Normal, FontStyles.Italic);
        private static readonly EqualConverter _isLeft = new EqualConverter(null, HorizontalCellAlignment.Left);
        private static readonly EqualConverter _isRight = new EqualConverter(null, HorizontalCellAlignment.Right);

        private static readonly EqualConverter _isSingleConverter = new EqualConverter(UnderlineType.None,
                                                                                       UnderlineType.Single);

        private static readonly EqualConverter _isTextWrapping = new EqualConverter(TextWrapping.NoWrap,
                                                                                    TextWrapping.Wrap);

        private static readonly EqualConverter _isTop = new EqualConverter(null, VerticalCellAlignment.Top);
        private static readonly EqualConverter _isVCenter = new EqualConverter(null, VerticalCellAlignment.Center);
        private static readonly MultiEqualConverter _multiEqualConverter = new MultiEqualConverter();

        private static readonly PaneStateToBooleanConverter _paneStateToBooleanConverter =
            new PaneStateToBooleanConverter();

        
        private static readonly ScaleColorsToBrushConverter _scaleColorsToBrushConverter =
            new ScaleColorsToBrushConverter();

        private static readonly StandardColorConverter _standardFillColorConverter = new StandardFillColorConverter();
        private static readonly StandardColorConverter _standardTextColorConverter = new StandardTextColorConverter();

        private static readonly StyleFinderConverter _styleFinderConverter = new StyleFinderConverter();

        private static readonly TableStyleElementToBackgroundConverter _tableStyleElementToBackgroundConverter =
            new TableStyleElementToBackgroundConverter();

        private static readonly VerticalCellAlignmentToVerticalAlignmentConverter _verticalCellAlignmentConverter =
            new VerticalCellAlignmentToVerticalAlignmentConverter();

        private static readonly WorksheetPaneToCommentsConverter _worksheetPaneToCommentsConverter =
            new WorksheetPaneToCommentsConverter();

        public static IMultiValueConverter StyleFinderConverter
        {
            get { return _styleFinderConverter; }
        }

        public static IValueConverter PaneStateToBooleanConverter
        {
            get { return _paneStateToBooleanConverter; }
        }

        public static IMultiValueConverter TableStyleElementToBackgroundConverter
        {
            get { return _tableStyleElementToBackgroundConverter; }
        }

        public static IValueConverter EnumToNameConverter
        {
            get { return DrawingConverters.EnumToNameConverter; }
        }

        public static IValueConverter GetColumnsConverter
        {
            get { return _getColumnsConverter; }
        }

        public static IMultiValueConverter WorksheetPaneToCommentsConverter
        {
            get { return _worksheetPaneToCommentsConverter; }
        }

        public static IValueConverter FromPercentConverter
        {
            get { return _fromPercentConverter; }
        }

        public static IMultiValueConverter FirstNonNullConverter
        {
            get { return _firstNonNullConverter; }
        }

        public static IMultiValueConverter EnsureWhiteConverter
        {
            get { return _ensureWhiteConverter; }
        }

        public static IValueConverter IndentationToThicknessConverter
        {
            get { return _indentationToThicknessConverter; }
        }

        public static IValueConverter BorderThicknessConverter
        {
            get { return _borderThicknessConverter; }
        }

        public static IValueConverter IsDoubleConverter
        {
            get { return _isDoubleConverter; }
        }

        public static IValueConverter IsSingleConverter
        {
            get { return _isSingleConverter; }
        }

        public static IValueConverter IsBold
        {
            get { return _isBold; }
        }

        public static IValueConverter IsItalic
        {
            get { return _isItalic; }
        }

        public static IValueConverter IsLeft
        {
            get { return _isLeft; }
        }

        public static IValueConverter IsRight
        {
            get { return _isRight; }
        }

        public static IValueConverter IsTop
        {
            get { return _isTop; }
        }

        public static IValueConverter IsBottom
        {
            get { return _isBottom; }
        }

        public static IValueConverter IsVCenter
        {
            get { return _isVCenter; }
        }

        public static IValueConverter IsHCenter
        {
            get { return _isHCenter; }
        }

        public static IValueConverter IsTextWrapping
        {
            get { return _isTextWrapping; }
        }


        public static IValueConverter ChartTemplateToImageSourceConverter
        {
            get { return _chartTemplateToImageSourceConverter; }
        }

        public static IMultiValueConverter FillToBackgroundBrushConverter
        {
            get { return _fillToBackgroundBrushConverter; }
        }

        public static IMultiValueConverter ColorToBrushConverter
        {
            get { return _colorToBrushConverter; }
        }

        public static IMultiValueConverter ScaleColorsToBrushConverter
        {
            get { return _scaleColorsToBrushConverter; }
        }

        public static IValueConverter VerticalCellAlignmentConverter
        {
            get { return _verticalCellAlignmentConverter; }
        }

        public static IValueConverter HorizontalCellAlignmentConverter
        {
            get { return _horizontalCellAlignmentConverter; }
        }

        public static IValueConverter StandardTextColorConverter
        {
            get { return _standardTextColorConverter; }
        }

        public static IValueConverter StandardFillColorConverter
        {
            get { return _standardFillColorConverter; }
        }

       
        public static IMultiValueConverter MultiEqualConverter
        {
            get { return _multiEqualConverter; }
        }
    }
}